package mylibrary.thread.waitAndNotify2;

public class WaxOff implements Runnable {

	private Car car;
	public WaxOff(Car c) {
		this.car = c;
	}
	
	public void run() {
		try{
			while(!Thread.interrupted()) {
				car.waitForWaxing();
				System.out.println("Wax Off!");
				Thread.sleep(200);
				car.buffed();
			}
		} catch(Exception e) {
			e.printStackTrace();
		}
		System.out.println("End Wax Off task");
	}
}
